<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use frontend\assets\AppAsset;

AppAsset::register($this);

$this->title = 'yii';

?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div id="body-wrap">
    <div id="header">
        <div class="container">
            <div class="pull-left" style="padding-top:10px;">
                <a href="/">
                    <img src="/res/img/dashou_brand.png" width="40px" height="40px"/>
                </a>
            </div>
            <ul class="hori-list header-nav-left pull-left" style="margin-left:20px;">
                <li><a href="/">控制台</a></li>
            </ul>
            <ul class="hori-list header-nav-right pull-right">
                <?php
                if(Yii::$app->user->isGuest) {
                    echo '<li><a href="/home/login">登录</a></li>';
                    echo '<li><a href="/home/register">注册</a></li>';
                } else {
                    echo '<li><a href="/">' . Yii::$app->user->identity->username . '</a></li>';
                    echo '<li><a href="/home/logout">退出</a></li>';
                }
                ?>
            </ul>
        </div>
    </div>

    <div class="container" style="padding-top:20px;">
        <?= $content ?>
    </div>


</div>

<div id="footer">
    <div class="container">
        <p class="pull-left">&copy; 2017</p>
        <p class="pull-right">大手</p>
    </div>
</div>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
